Skip to content

Comments

[knx] Prevent reconfiguration of Things during device discovery#19839

Merged
kaikreuzer merged 1 commit intoopenhab:mainfrom
holgerfriedrich:pr-knx-discovery2
Dec 20, 2025
Merged

[knx] Prevent reconfiguration of Things during device discovery#19839
kaikreuzer merged 1 commit intoopenhab:mainfrom
holgerfriedrich:pr-knx-discovery2

Conversation

@holgerfriedrich
Copy link
Member

@holgerfriedrich holgerfriedrich commented Dec 19, 2025

Prevents reconfiguration of connection type during discovery runs. Previously, existing Things were rediscovered and reconfigured to default connection type.

This comes with the drawback that all discovered devices need to be manually configured (i.e. set a proper connection type). Initially, they will be in state HANDLER_CONFIGURATION_PENDING {type=...}
If you copy the code snippet from Inbox, the mandatory parameter type=... is missing.

Alternative to #19828, fixes #19824

Prevents reconfiguration of connection type during discovery runs.
Previously, existing Things were rediscovered and reconfigured
to default connection type.

This comes with the drawback that all discovered devices need
to be manually configured (i.e. set a proper connection type).

Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
@holgerfriedrich holgerfriedrich added the bug An unexpected problem or unintended behavior of an add-on label Dec 19, 2025
.withLabel(response.getDevice().getName() + " (router mode)")
.withProperty("serialNumber", serial + "-r").withProperty("type", "ROUTER")
.withProperty("ipAddress", "224.0.23.12")
.withProperty("serialNumber", serial + "-r").withProperty("ipAddress", "224.0.23.12")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know, it is unrelated to this PR, but as I stumble over it here: Why is the IP address of the router set to its multicast address? Surely, the router listens via multicast, but it also has a physical IP address, which I would rather expect here. I would rather either set the physical address (i.e. similar as for tunnel) or omit the ip address completely as it is of no specific value (as the multicast address is static and identical for all KNX routers).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://www.openhab.org/addons/bindings/knx/#ip-gateway

If I get the docs correctly, it says that you could put the multicast address.

I don't have routers (not even older ones without security) at hand, so this part is a bit weak.....

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"the IPv4 Multicast Address can be set" ... but is useless.
Well, nothing to change for 5.1, but maybe this should simply be removed for 5.2...

@jlaur jlaur changed the title [knx] Prevent reconfigutation of Things during device discovery [knx] Prevent reconfiguration of Things during device discovery Dec 20, 2025
Copy link
Member

@kaikreuzer kaikreuzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's choose the low-risk approach to be on the safe side!

@kaikreuzer kaikreuzer merged commit 6e4ee70 into openhab:main Dec 20, 2025
3 checks passed
@holgerfriedrich holgerfriedrich deleted the pr-knx-discovery2 branch December 21, 2025 09:08
@holgerfriedrich
Copy link
Member Author

@kaikreuzer
Seems we have chosen the wrong way: now the IP address is still changed
https://community.openhab.org/t/knx-secure-with-mdt-ip-routers-not-working-after-restart-of-oh/167536/11

:-(

@kaikreuzer
Copy link
Member

That's actually a report not about the type but about the IP address changing - and it concerns the issue I had mentioned: The multicast address simply does not belong in that field, the automatic update actually does the correct thing...
The clean solution would actually to fix the binding logic to not use the ip address, but simply to go for multicast in the case of a router type.

@holgerfriedrich
Copy link
Member Author

Not exactly, it seems the router announces both tunnel and routing mode. I am preparing something to improve it for routers. Give me a bit time to submit the PR.

holgerfriedrich added a commit to holgerfriedrich/openhab-addons that referenced this pull request Dec 21, 2025
Follow-up to openhab#19839.
Discover separate Things for KNX IP routers and avoid setting
IP address and port for routers. Routers use a defined multicast
address.

Make sure that Thing for router is separate, event if the same device
exports a tunneling device.

Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
kaikreuzer pushed a commit that referenced this pull request Dec 21, 2025
Follow-up to #19839.
Discover separate Things for KNX IP routers and avoid setting
IP address and port for routers. Routers use a defined multicast
address.

Make sure that Thing for router is separate, event if the same device
exports a tunneling device.

Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
@jlaur jlaur added this to the 5.1 milestone Dec 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug An unexpected problem or unintended behavior of an add-on

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[knx] IP interface config changes back to TUNNEL or ROUTER

3 participants